﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>


    <script type="text/javascript">
        function Save() {
            var saveUrl = "/SimpleWord/SaveDoc";
            pageofficectrl.SaveFilePage = saveUrl;
            //在这里写您保存前的代码
            pageofficectrl.WebSave();
            //在这里写您保存后的代码，比如判断保存结果pageofficectrl.CustomSaveResult
            if ("ok" == pageofficectrl.CustomSaveResult) {
                alert("保存成功！");
            } else {
                alert("保存失败！");
            }
        }
        function SaveAs() {
            pageofficectrl.ShowDialog(3);
        }
        function PrintSet() {
            pageofficectrl.ShowDialog(5);
        }
        function PrintFile() {
            pageofficectrl.ShowDialog(4);
        }
        function Close() {
            pageofficectrl.CloseWindow()
        }
        function IsFullScreen() {
            pageofficectrl.FullScreen =
                !pageofficectrl.FullScreen;
        }

        function OnPageOfficeCtrlInit() {
            pageofficectrl.AddCustomToolButton("保存", "Save", 1);
            pageofficectrl.AddCustomToolButton("另存为", "SaveAs", 12);
            pageofficectrl.AddCustomToolButton("打印设置", "PrintSet", 0);
            pageofficectrl.AddCustomToolButton("打印", "PrintFile", 6);
            pageofficectrl.AddCustomToolButton("全屏/还原", "IsFullScreen", 4);
            pageofficectrl.AddCustomToolButton("-", "", 0);
            pageofficectrl.AddCustomToolButton("关闭", "Close", 21);
        }
    </script>
    <div style="width:auto;height:900px;">
        @Html.Raw(ViewBag.poCtrl)
    </div>
    
</body>
</html>
